package com.qianli.user.domain.facatory;

import com.qianli.user.domain.model.UserFeatureModel;
import com.qianli.user.domain.respository.UserFeatureRespository;
import com.qianli.user.ro.feature.FeatureTagRO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * name:特征信息
 * auth:ting.li@qianli-inc.com
 * date:2018/1/2 15:46
 * version: v1.0.0
 **/
@Service
public class UserFeatureFactory {

    @Autowired
    private UserFeatureRespository userFeatureRespository;

    /**
     * 加载特征信息
     *
     * @param model
     */
    public void load(UserFeatureModel model) {

        userFeatureRespository.load(model);
    }

    /**
     * 保存特征信息
     *
     * @param newUm
     */
    public void store(UserFeatureModel newUm) {
        userFeatureRespository.store(newUm);
    }

    /**
     * 移除标签
     *
     * @param newUm
     */
    public void restore(UserFeatureModel newUm) {
        userFeatureRespository.restore(newUm);

    }

    /**
     * 查询该app所有标签
     *
     * @param appCode
     * @param biz
     * @return
     */
    public List<FeatureTagRO> queryAllFeatureTags(String appCode, Integer biz) {
        List<FeatureTagRO> featureTagROEs = userFeatureRespository.queryAllFeatureTags(appCode, biz);
        return featureTagROEs;
    }
}
